<script>
export default {
	onLaunch: function (res) {
		console.log("App Launch");
		// 全局检查 token 是否存在
		const token = uni.getStorageSync("token");
		if (!token && JSON.stringify(res.query) === "{}") {
			// 如果没有 token，跳转到登录页
			uni.navigateTo({
				url: "/pages/login/login",
			});
		}
	},
	onShow: function () {
		console.log("App Show");
	},
	onHide: function () {
		console.log("App Hide");
	},
};
</script>

<style lang="scss">
// 导入阿里巴巴矢量图标库
/*#ifdef MP*/
@import "@/static/css/iconfont/iconfont.css";
/*#endif*/
/*每个页面公共css */
@import "@/static/css/reset.scss";
@import "@/static/css/theme.scss";
@import "@/uni.scss";
</style>
